package com.ldy.question;

/**
 * <br>
 * 版权: Copyright (c) 2011-2018<br>
 * 公司: 活力天汇<br>
 *
 * @author: 刘德咏<br>
 * @date: 2018-04-19<br>
 */
public class ConcurrentSinglaton {
    private ConcurrentSinglaton() {
    }

    private static ConcurrentSinglaton instance;


    public static ConcurrentSinglaton getInstance() {
        try {
            if (instance == null) {
                synchronized (ConcurrentSinglaton.class) {
                    if (instance == null) {
                        instance = new ConcurrentSinglaton();
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return instance;
    }
}
